package com.rms.rmd.util;

import java.util.regex.Pattern;

/**
 * Common utility class
 */
public class CommonUtil {
	private final static Pattern LTRIM = Pattern.compile("^\\s+");
	private final static Pattern RTRIM = Pattern.compile("\\s+$");

	/**
	 * left trim
	 * @param s
	 * @return
	 */
	public static String ltrim(String s) {
	    return LTRIM.matcher(s).replaceAll("");
	}

	/**
	 * right trim
	 * @param s
	 * @return
	 */	
	public static String rtrim(String s) {
	    return RTRIM.matcher(s).replaceAll("");
	}	
}
